import request from '@/config/axios'

// 宽带批发配置（房产） VO
export interface NetGroupPayHouseMapVO {
  // 编号
  id: number
  // 中间件ID
  netSysId: number
  // 房产ID
  houseId: number
  // 房产地址
  houseName: string    
  // 分账模式（0单账户 1多账户比例分账 2多账户金额分账）
  divideMode: number
  divideMatUserName1_: undefined
  divideMatId1: undefined
  divideMatCode1_: undefined
  divideMatValue1: undefined
  divideMatUserName2_: undefined
  divideMatId2: undefined
  divideMatCode2_: undefined
  divideMatValue2: undefined
  underTakeMatCode: undefined   
  underTakeMatName_: undefined
}

// 宽带批发配置（房产） API
export const NetGroupPayHouseMapApi = {
  // 查询宽带批发配置（房产）分页
  getNetGroupPayHouseMapPage: async (params: any) => {
    return await request.get({ url: `/zwsj/net-group-pay-house-map/page`, params })
  },

  // 查询宽带批发配置（房产）详情
  getNetGroupPayHouseMap: async (id: number) => {
    return await request.get({ url: `/zwsj/net-group-pay-house-map/get?id=` + id })
  },

  // 新增宽带批发配置（房产）
  createNetGroupPayHouseMap: async (data: NetGroupPayHouseMapVO) => {
    return await request.post({ url: `/zwsj/net-group-pay-house-map/create`, data })
  },

  // 修改宽带批发配置（房产）
  updateNetGroupPayHouseMap: async (data: NetGroupPayHouseMapVO) => {
    return await request.put({ url: `/zwsj/net-group-pay-house-map/update`, data })
  },

  // 删除宽带批发配置（房产）
  deleteNetGroupPayHouseMap: async (id: number) => {
    return await request.delete({ url: `/zwsj/net-group-pay-house-map/delete?id=` + id })
  },

  // 导出宽带批发配置（房产） Excel
  exportNetGroupPayHouseMap: async (params) => {
    return await request.download({ url: `/zwsj/net-group-pay-house-map/export-excel`, params })
  },
  
  // 获取宽带分账兜底账户
  getNetUnderTakeMat: async (divideMode: number) => {
    return await request.get({ url: `/zwsj/net-group-pay-house-map/of/under/take/by/divide/mode/${divideMode}` })
  },
}
